<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui">
    <ui:define name="content">
        <h:form>
            type:<p:inputText value="#{articleTypeController.entity.name}"/>
            <p:commandButton value="Save" update="@form" action="#{articleTypeController.persist()}"/>
            <p:dataTable value="#{articleTypeController.dataModel}"
                         var="entity"
                         rows="20"
                         rowIndexVar="index"
                         rowKey="#{entity}"
                         lazy="true"
                         paginatorPosition="top"
                         paginator="true">
                <p:column headerText="type">                      
                    #{entity.name}
                </p:column>
                <p:column>
                    <p:commandButton process="@this"
                                     value="edit"                                     
                                     update="@form"
                                     actionListener="#{articleTypeController.setEntity(entity)}"/>
                    <p:commandButton process="@this"
                                     value="reomve"                                     
                                     update="@form"
                                     actionListener="#{articleTypeController.remove(entity)}"/>
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>
